/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig } from 'vite'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// console.log(path);
const url = 'https://keaizhu.gitee.io/rabbit/'
// https://vitejs.dev/config/

console.log(__dirname,1);
export default defineConfig({
  base: process.env.NODE_ENV === 'production' ? 'rabbit/' : '/',
  plugins: [
    vue(),
    AutoImport({
      resolvers: [ElementPlusResolver()]
    }),
    Components({
      resolvers: [ElementPlusResolver()]
    })
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
      '!': path.resolve(__dirname, './src/components')
    }
  },
  server: {
    host: true,
    port: 4000
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: "@import './src/style/vars.scss';"
      }
    }
  }
})
